namespace SV_FIU_PROCESS_VARIANTS {
﻿#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>

int main(int argc, char* argv[]) {
	int fd;

	if ((fd = open(argv[1], 0)) == -1) {
		error("can't open %s", argv[1]);
		return -1;
	}
	if (argc == 2) {/* execute command */
		if (execlp("/bin/sh/", "sh", "-c", argv[1], (char*)0)) {

			         /* some code */
		}
		else {
			error("can't execute %s", argv[1]);
		}
	}
}

#include <stdlib.h>
  /* Execute a program passed as a command-line argument */
int main(char* argv[])
{
	system(argv[1]); /* NON-COMPLIANT */

	return 0;
}

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>

int main(int argc, char* argv[]) {
	int fd;

	if ((fd = open(argv[1], 0)) == -1) {
		error("can't open %s", argv[1]);
		return -1;
	}
	if (argc == 2) {/* execute command */
		if (execve("/bin/sh/", "sh", "-c", argv[1], (char*)0)) {

			         /* some code */
		}
		else {
			error("can't execute %s", argv[1]);
		}
	}
}

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int    main(int argc, char* argv[])
{
	char* newargv[] = { NULL, "hello", "world", NULL };
	char* newenviron[] = { NULL };

	if (argc != 2) {

		fprintf(stderr, "Usage: %s <file-to-exec>\n", argv[0]);

		exit(EXIT_FAILURE);

	}

	newargv[0] = argv[1];

	execve(argv[1], newargv, newenviron); /* COMPLIANT */
	perror("execve");                     /* execve() only returns on error */
	exit(EXIT_FAILURE);
}
}}